package com.joseph.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.joseph.dao.OrderDao;
import com.joseph.dao.ProductDao;

/**
 * @description 
 * @author Joseph_Mok
 * @date 2016年1月21日下午6:05:26
 */

@Service
public class SeckillService {

	@Resource
	private ProductDao productDao;
	
	@Resource
	private OrderDao orderDao;
	
	public void doSeckill(String phone) {
		productDao.getStore();
		int i = productDao.updateStore();
		if (i == 1) {
			orderDao.insert(phone);
		} else {
			System.out.println("bad request");
		}
	}
}
